RegisterMyName
).
On the client side, (when receiving a sleepDemand
request),
I wait until
network activity has ceased, then return control to the system. The
client wakes and reconnects to the server with no problems.
AutoSleepControl(false)
.
Otherwise, the clients might
never know that your server is sleeping, and will be unable to connect.
But if you do want to support sleep, then a server should install
a sleep procedure through the Power Manager using
SleepQInstall
.
The exact interaction of how your server should handle
sleepRequest/SleepDemand
is detailed in table 6-1 on
pg 6-10 of Inside Macintosh: Devices.
Ultimately, you close and deregister your server from the network.
Later, when you get the sleepWakeUp
call, you should reopen
and re-register.
sleepDemand
if the user selects Sleep from the Special menu. The
AutoSleepControl(false)
call will stop sleepRequests
but will it also stop SleepDemands
?sleepDemand
, as documented in
Inside Macintosh: Devices pg 6-11:When your sleep procedure receives a sleep demand, however, your procedure has no way to determine whether it originated as a conditional sleep demand or an unconditional sleep demand. Your device driver or application must prepare for the sleep state and return control promptly to the Power Manager when it receives a sleep demand.
As for AutoSleepControl
, please refer to
Inside Macintosh: Devices pg 6-44:
When enableSleep is set to false, the computer will not go into the sleep mode unless it is forced to either by some user action --for example, by the user's selecting Sleep from the Special menu of the Finder --or in a low battery situation.